#include <p32xxxx.h>
#include <plib.h>
#include "Bike_Display_ECM_Functions.h"
#include "Bike_Display_HW_Profile.h"

char ReceiveBuffer[30];

void ECMInit(void) 
{
}

// helper functions
void WriteString(const char *string)
{
    while(*string != '\0')
    {
        while(!UARTTransmitterIsReady(UART5));

        UARTSendDataByte(UART5, *string);

        string++;

        while(!UARTTransmissionHasCompleted(UART5));
    }
}

void PutCharacter(const char character)
{
    while(!UARTTransmitterIsReady(UART5));
    //WriteString("\n");
    UARTSendDataByte(UART5, character);
    //WriteString(" %02x\r\n", character);
    //WriteString("\r\n");
    while(!UARTTransmissionHasCompleted(UART5));
}
